package com.wwwarehouse.financialcenter.fragment.moneywarehouse.bankcard;


import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.wwwarehouse.common.bean.response.CommonClass;
import com.wwwarehouse.common.eventbus_event.CardDeskEvent;
import com.wwwarehouse.financialcenter.R;
import com.wwwarehouse.financialcenter.fragment.base.TheParentFragment;

import de.greenrobot.event.EventBus;

/**
 * Description: 企业银行卡添加成功页面
 * Copyright  : Copyright (c) 2017
 * Author     : yfwang
 * Date       : 2017/11/13 10:35
 */
public class AddSuccessFragment extends TheParentFragment implements View.OnClickListener {

    private TextView mAddNext;
    private TextView mComplete;
    private TextView mTips;
    private Bundle bundle;

    @Override
    protected int getContentId() {
        return R.layout.financial_center_fragment_add_success;
    }

    @Override
    protected void init(View view) {
        mAddNext = findView(view, R.id.btn_next);
        mComplete = findView(view, R.id.btn_complete);
        mTips = findView(view, R.id.tv_tips);
        mAddNext.setOnClickListener(this);
        mComplete.setOnClickListener(this);
        bundle = getArguments();
    }

    @Override
    public void onSuccess(CommonClass commonClass, int what) {

    }

    @Override
    public void onReLoad(int code) {

    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.btn_next) {
            popFragment();
            AddEnterpriseBankFragment addEnterpriseBankFragment = new AddEnterpriseBankFragment();
            addEnterpriseBankFragment.setArguments(bundle);
            pushFragment(addEnterpriseBankFragment);
        } else if (id == R.id.btn_complete) {
            EventBus.getDefault().post(new CardDeskEvent("clear_back_stack"));
        }
    }
}
